 <%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<jsp:include flush="true" page="../header.jsp"></jsp:include>

<div id="main">
	<div class="t3" style="margin: 8px auto">
		<table width="100%" cellspacing="0" cellpadding="0" align="center">
			<tr>
				<td>
					<strong class="fl w"> <img
							src="images/yellow/index/home_menu.gif" align="absmiddle"
							id="td_cate" onMouseOver="read.open('menu_cate','td_cate');"
							style="cursor: pointer;" /> <s:url action="list_category"
							id="url">
							<s:param name="category.id">${ board.category.id }</s:param>
						</s:url> <a href="${url}">${ board.category.name }</a> &raquo; <s:url
							action="list_board" id="url">
							<s:param name="board.id">${ board.id }</s:param>
						</s:url> <a href="${url}">${ board.name }</a> </strong>
					<div class="fr w">
						<s:url action="initSetAdmin_board" id="url">
							<s:param name="board.id">${ board.id }</s:param>
						</s:url>
						<a href="${url}">版主</a>: &nbsp;
						<c:forEach items="${ board.administrators }" var="person">
							<s:url action="view_person" id="url" namespace="/system">
								<s:param name="person.id">${ person.id }</s:param>
							</s:url>
							<a href="${url}">${ person.name }</a>
						</c:forEach>
					</div>
				</td>
			</tr>
		</table>
	</div>

	<div class="c"></div>

	<div class="t3">
		<table width="100%" align="center" cellspacing="0" cellpadding="0">
			<tr>
				<td align="left" valign="middle">
					<div class="fl">
						<div class="pages">
							${ pagination }
						</div>
					</div>
				</td>
				<td style="text-align: right">
					<s:url action="initAdd_thread" id="url">
						<s:param name="board.id">${ board.id }</s:param>
					</s:url>
					<a href="${url}"><img src="images/yellow/post.png" id="td_post" />
					</a>
				</td>
			</tr>
		</table>
	</div>


	<div class="t z" style="margin: 3px auto">
		<table cellspacing="0" cellpadding="0" width="100%" id="ajaxtable">
			<tr>
				<th class="h" colspan="7">
					<s:url action="list_board" id="url">
						<s:param name="board.id">${ board.id }</s:param>
					</s:url>
					<a href="${url}">${ board.name }</a>
				</th>
			</tr>
			<tbody style="table-layout: fixed;">
				<tr></tr>
				<tr class="tr2">
					<td class="tac y-style">
						状态
					</td>
					<td style="width: 45%" class="tac">
						帖子
					</td>
					<td style="width: 15%" class="y-style">
						作者
					</td>
					<td style="width: 6%" class="y-style">
						回复
					</td>
					<td style="width: 6%" class="y-style">
						人气
					</td>
					<td style="width: 15%" class="y-style">
						最后回复
					</td>
					<s:if test="#session.personInfo.group=='manager'">
						<td style="width: 9%" class="y-style">
							编辑|删除
						</td>
					</s:if>
				</tr>


				<c:forEach var="thread" items="${ threadList }">

					<tr align="center" class="tr3 t_one">
						<td>
							<s:url action="list_thread" id="url">
								<s:param name="thread.id">${ thread.id }</s:param>
								<s:param name="flag">hit</s:param>
							</s:url>
							<a title="打开新窗口" href="${url}" target="_blank"><img
									src="images/yellow/thread/topichot.gif" border=0> </a>
						</td>
						<td style="text-align: left; padding-left: 8px" id="td_579742">
							<h3>
								<s:url action="list_thread" id="url">
									<s:param name="thread.id">${ thread.id }</s:param>
									<s:param name="flag">hit</s:param>
								</s:url>
								<a href="${ url }">${ thread.title }</a>
							</h3>
						</td>
						<td class="tal y-style">
							<s:url action="view_person" id="url" namespace="/system">
								<s:param name="person.id">${ thread.author.id }</s:param>
							</s:url>
							<a href="${url }" class="bl">${ thread.author.name }</a>
							<div class="f10">
								<fmt:formatDate value="${thread.dateCreated }" pattern="yyyy-MM-dd HH:mm:ss" />
							</div>
						</td>
						<td class="tal f10 y-style">
							${ thread.replyCount }
						</td>
						<td class="tal f10 y-style">
							${ thread.hit }
						</td>
						<td class="tal y-style">
							&nbsp;
							<c:if test="${ thread.authorLastReplied != null }">
								<s:url action="view_person" id="url" namespace="/system">
									<s:param name="person.id">${ thread.authorLastReplied.id }</s:param>
								</s:url>
								<a href="${url}" class="bl">${
									thread.authorLastReplied.name }</a>
								<div class="f10">
								<fmt:formatDate value="${thread.dateLastReplied }" pattern="yyyy-MM-dd HH:mm:ss" />
								</div>
							</c:if>
						</td>
						<s:if test="#session.personInfo.group=='manager'">
							<td>
							<s:url action="view_thread" id="url">
							<s:param name="thread.id">${thread.id}</s:param>
							<s:param name="flag">edit</s:param>
							</s:url>
								<s:a href="%{url}">编辑</s:a>|
								<s:url action="delete_thread" id="url">
							<s:param name="thread.id">${thread.id}</s:param>
							</s:url>
								<s:a href="%{url}">删除</s:a>
							</td>
						</s:if>
					</tr>
				</c:forEach>
				<tr>
					<td colspan="6" class="f_one" style="height: 8px"></td>
				</tr>
			</tbody>
		</table>
	</div>

	<div class="t3">
		<table cellspacing="0" cellpadding="0" width="100%" align="center">
			<tr valign="top">
				<td align="left">
					<div class="pages">
						${ pagination }
					</div>
				</td>
				<td style="text-align: right; padding-top: 5px">
					<s:url action="initAdd_thread" id="url">
						<s:param name="board.id">${ board.id }</s:param>
					</s:url>
					<a href="${url}"><img src="images/yellow/post.png" id="td_post" />
					</a>
				</td>
			</tr>
		</table>
	</div>
</div>


<jsp:include flush="true" page="../footer.jsp" />
